package demo;
import listener.a;

import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class afd {
    public static void main(String[] args) {

        a a = new a();
        a.test();
        System.out.println(a.filePath);

    }

    public void test(){
        File f = new File(this.getClass().getResource("/").getPath());
        String s = f.toString();

        String pattern = "\\w.*Javaweb_demo1";

        // 创建 Pattern 对象
        Pattern r = Pattern.compile(pattern);

        // 现在创建 matcher 对象
        Matcher m = r.matcher(s);

        if (m.find( )) {
            System.out.println("Found value: " + m.group(0) );

        } else {
            System.out.println("NO MATCH");
        }
    }
}
